#include "particles/VectorBasedParticlePopulation.hpp"

VectorBasedParticlePopulation::VectorBasedParticlePopulation() {
}

VectorBasedParticlePopulation::~VectorBasedParticlePopulation() {
	plist.clear();
}

unsigned VectorBasedParticlePopulation::size() {
	return plist.size();
}

void VectorBasedParticlePopulation::add(Particle *p) {
	plist.push_back(p);
}

bool VectorBasedParticlePopulation::remove(unsigned i) {
	if (i<plist.size()) {
		plist.erase(plist.begin()+i);
		return true;
	}
	return false;
}

Particle* VectorBasedParticlePopulation::get(unsigned i) {
	return plist[i];
}
